/*
 * @Author: shijianxin
 * @Date: 2022-04-15 16:10:09
 * @Description: 电影数据库文件
 */

import Mongoose from "mongoose";
import { Movie } from "../entities/Movie";

export interface IMovie extends Movie, Mongoose.Document {}

const movieSchema = new Mongoose.Schema<IMovie>(
  {
    name: String,
    types: [String],
    areas: [String],
    timeLong: Number,
    isHot: Boolean,
    isComing: Boolean,
    isClassic: Boolean,
    description: String,
    poster: String,
  },
  { versionKey: false }
);

export default Mongoose.model<IMovie>("Movie", movieSchema);
